package com.itshizhan.itjidancideveloper.dao.ucenter

import com.itshizhan.itjidancideveloper.models.Word
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.JpaSpecificationExecutor
import org.springframework.data.jpa.repository.Query

interface WordDao : JpaRepository<Word, Long>, JpaSpecificationExecutor<Word> {
  //jpql 不支持 limit，所以使用nativeQuery
  @Query(nativeQuery = true, value = "SELECT * FROM base_word w WHERE w.wordname LIKE CONCAT('%',?1,'%')  LIMIT 10")
  fun findByWordNameLike(wordName:String):MutableList<Word>
}